include ../../Makefile.conf
compile:
	mkdir -p tmp dist
	find tmp -name "*.class" -exec rm  '{}' ';'
	-cp -r src/ ../core/src/ tmp/ 2> /dev/null
	-find tmp -type d -name ".svn" -exec rm -rf '{}' ';'
	$(JAVAC) -cp $(APACHE_HTTPCLIENT):$(VELOCITY_LIB) -sourcepath tmp/src tmp/src/fr/cephb/mw4ceph/MediaWiki4Ceph.java
	$(JAR) cvf dist/mw4ceph.jar -C tmp/src .
	rm -rf tmp
test:compile
	$(JAVA) -cp $(APACHE_CODEC):$(APACHE_LOGGING):$(APACHE_HTTPCLIENT):$(VELOCITY_LIB):$(VELOCITY_DEP):dist/mw4ceph.jar fr.cephb.mw4ceph.MediaWiki4Ceph ${HOME}/tmp/GA/090515_HWUSI-EAS539_0008_30TTHAAXX ${HOME}/tmp/GA/090515_HWUSI-EAS539_0008_30TTHAAXX
zip:compile
	mkdir -p mw4ceph_dist
	cp  dist/mw4ceph.jar mw4ceph_dist/
	cp $(APACHE_CODEC) mw4ceph_dist/codec.jar
	cp $(APACHE_LOGGING) mw4ceph_dist/logging.jar
	cp $(APACHE_HTTPCLIENT) mw4ceph_dist/httpclient.jar
	cp $(VELOCITY_LIB) mw4ceph_dist/velocity.jar
	cp $(VELOCITY_DEP) mw4ceph_dist/velocitydep.jar
	echo "#!/bin/sh" > mw4ceph_dist/run.sh
	echo "H=\`dirname \$$0\`" >> mw4ceph_dist/run.sh
	echo "java -cp \$${H}/mw4ceph.jar:\$${H}/codec.jar:\$${H}/logging.jar:\$${H}/httpclient.jar:\$${H}/velocity.jar:\$${H}/velocitydep.jar fr.cephb.mw4ceph.MediaWiki4Ceph \$$@" >> mw4ceph_dist/run.sh
	zip -r dist/mw4ceph.zip mw4ceph_dist
	rm -rf mw4ceph_dist
clean:
	rm -rf tmp dist/mw4ceph.jar mw4ceph_dist dist/mw4ceph.zip
	find tmp -name "*.class" -exec rm '{}' ';'

	
	